//
//  TestClass.swift
//  AltynBankFramework
//
//  Created by Zhu Jinxin on 2018/11/14.
//  Copyright © 2018 Zhu Jinxin. All rights reserved.
//

import UIKit

public class TestClass: NSObject {

   public func instanceTestMethod() {

    print("Switf instance Method Test")
    
//     SVProgressHUD.show()
    
    }
    
   public static func classTestMethod(){
      print("Switf Class Method Test")
    
//     SVProgressHUD.show()
    
    }
    
    public static func createTestEntry(){
        
        let testvc = UIViewController()
        
        let imgv = UIImageView(frame: CGRect(x: 100, y: 100, width: 100, height: 100))
        imgv.backgroundColor = UIColor.yellow
        testvc.view.backgroundColor = UIColor.white
        testvc.view.addSubview(imgv)
        
        imgv.image = TestClass.returnAImage()
        
        let curretVC = UIApplication.shared.activeViewController()
        
        curretVC?.navigationController?.pushViewController(testvc, animated: true)
        
    }
    
    public static func returnAImage()->(UIImage?){
        
//        let bd1 = Bundle(for: self)
//        print(self)
//           print("bdpath:\(bd1)")
//
//   let img = UIImage(named: "ic_bg1", in: bd1, compatibleWith: nil)
//        print("img:\(img)")

        
        let bdpath = Bundle.main.path(forResource: "AltynBankResource", ofType: "bundle")
        print("bundlePath:\(bdpath)")
        let bd = Bundle(path: bdpath ?? "")
       print("bundle:\(bd)")
        let img = UIImage.init(named: "ic_bg1", in: bd, compatibleWith: nil)
        print("img:\(img)")
        
        
        return img
    }
    
    
    
}
